package receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.NetworkInfo;
import android.widget.Toast;

public class NetReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent != null) {
            NetworkInfo networkInfo = intent.getParcelableExtra("networkInfo");

            Toast.makeText(context,"net change " + networkInfo.getTypeName()+networkInfo.getSubtypeName(),Toast.LENGTH_LONG).show();
        }
    }
}
